package com.ktjiaoyu.crm;

import com.ktjiaoyu.crm.mapper.UserMapper;
import com.ktjiaoyu.crm.pojo.User;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class MyBatisTester {

    @Autowired
    private UserMapper userMapper;

    @Test
    public void testInsert() throws Exception{
        int result = userMapper.insertUser(new User("曹操","123",1l,0));
        if(result==1) System.out.println("插入成功！！");
    }

    @Test
    public void deleteUser() throws Exception{
        int count = userMapper.deleteUserById(42);
        if(count==1) System.out.println("删除成功！");
    }

}
